{"mode":"Blocks","workspace":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable id=\"_2.^beQjx|FGt38A,8(E\">myVariable</variable><variable type=\"list\" arraylength=\"2\" id=\"s35oq#9@a{hUWSQXniyD\">length</variable><variable type=\"broadcast_msg\" id=\"9B7$-6{bR=.WE^T6P(F-\">lights_on</variable><variable type=\"broadcast_msg\" id=\"k56L=Ia1K*tSeDfHjw4q\">message1</variable></variables><block type=\"iq_control_forever\" id=\"3?UyM}of6Ac-_.U~88IJ\" x=\"630\" y=\"-510\"><statement name=\"SUBSTACK\"><block type=\"iq_looks_set_cursor_new\" id=\"u6INe42]CL)l=cxEe9.`\"><field name=\"TARGET\">Brain</field><value name=\"ROW\"><shadow type=\"math_whole_number\" id=\"L~TL`H46G+7}?|-_VOXA\"><field name=\"NUM\">1</field></shadow></value><value name=\"COLUMN\"><shadow type=\"math_whole_number\" id=\"[A1GV`edJRXw`-@6RGQc\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"iq_looks_print_new\" id=\"-|uMSy{=I~rU]Q9bD/q*\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">true</field><value name=\"DATA\"><shadow type=\"text\" id=\"L;{P0knk*^7ufOkt@=ez\"><field name=\"TEXT\">VEXcode</field></shadow><block type=\"iq_sensing_optical_color\" id=\"CIYJ;JbKYb#^AqS)QJ:$\"><field name=\"OPTICAL\">Optical3</field></block></value><next><block type=\"iq_looks_print_new\" id=\"{yoM6n.jI~ATBR+3csQS\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">true</field><value name=\"DATA\"><shadow type=\"text\" id=\"(wvh|IuWs{|kv1IKj+5O\"><field name=\"TEXT\">VEXcode</field></shadow><block type=\"iq_sensing_optical_brightness\" id=\"M#:P_T_1y=_IvOR}Gc^r\"><field name=\"OPTICAL\">Optical3</field></block></value><next><block type=\"iq_looks_print_new\" id=\"_yQ(5!8#V0kV+efAg=,N\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">true</field><value name=\"DATA\"><shadow type=\"text\" id=\":Ht_7]*[0QR)qKC]@UK}\"><field name=\"TEXT\">VEXcode</field></shadow><block type=\"iq_sensing_optical_hue\" id=\"Ywa6`O7_P3*Xa(R-8I^I\"><field name=\"OPTICAL\">Optical3</field></block></value><next><block type=\"iq_control_if_then\" id=\"u3h@`|=R#PwsiO$PDTO?\"><value name=\"CONDITION\"><block type=\"iq_sensing_optical_found_object\" id=\"zisea~F0SDjBEPH9^~;(\"><field name=\"OPTICAL\">Optical3</field></block></value><statement name=\"SUBSTACK\"><block type=\"iq_looks_print_new\" id=\"mM_,jQIM3hnAgz%,X-Yg\"><field name=\"TARGET\">Brain</field><field name=\"andsetcursortonextrow_mutator\">true</field><value name=\"DATA\"><shadow type=\"text\" id=\"Z3N7T^XU2G$aPRPsms*;\"><field name=\"TEXT\">found object</field></shadow></value></block></statement><next><block type=\"iq_control_wait\" id=\"zC|Z_-hz]ZXehcNY[H*s\"><value name=\"DURATION\"><shadow type=\"math_positive_number\" id=\"a!~fxZKa:l_p+Jv1MK;i\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"iq_looks_clear_all_rows_new\" id=\"?FFTDDz*8pLif#0n%X*S\"><field name=\"TARGET\">Brain</field></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"iq_events_when_started\" id=\".NsXwU_L.OuU1l7Sho$F\" x=\"230\" y=\"-210\"><next><block type=\"iq_drivetrain_drive\" id=\"!oqfZ+`q9iHme!!9Jj:v\"><field name=\"DIRECTION\">fwd</field><next><block type=\"iq_control_wait_until\" id=\"]V?yZ!j{Eg}KH;)jn.lM\"><value name=\"CONDITION\"><block type=\"iq_sensing_optical_detect\" id=\"5]cDvxIb~WU2^{t74OU-\"><field name=\"OPTICAL\">Optical3</field><field name=\"COLORS\">green</field></block></value><next><block type=\"iq_motion_stop_driving\" id=\"j3YA`cWoQ%]~6Qa5q%Ex\"></block></next></block></next></block></next></block><block type=\"iq_control_repeat_until\" id=\"t*nz[;C$b%_eL3wsi!{4\" x=\"1090\" y=\"70\"><value name=\"CONDITION\"><block type=\"iq_sensing_optical_detect\" id=\"L[DF]D26A.,pr+uoPAid\"><field name=\"OPTICAL\">Optical3</field><field name=\"COLORS\">red</field></block></value></block><block type=\"iq_events_when_broadcasted\" id=\"0ko:yP~%?z6e#%pA)qN(\" x=\"1110\" y=\"270\"><field name=\"BROADCAST_OPTION\" id=\"9B7$-6{bR=.WE^T6P(F-\" variabletype=\"broadcast_msg\">lights_on</field><next><block type=\"procedures_call\" id=\"b[k[`b3X8Jug,o!F+IG^\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" proccode=\"lights %n\" proceduredefid=\"f*_VQdK?|HJ4-h;2OAA#\" argumentids=\"[&quot;tR*pBG{pSIiB=!g+y,uO&quot;]\" warp=\"false\"></mutation><value name=\"tR*pBG{pSIiB=!g+y,uO\"><shadow type=\"math_number\" id=\"]s5I~qnX%p/_uQ6fz+M9\"><field name=\"NUM\">1</field></shadow></value></block></next></block><block type=\"procedures_definition\" id=\"pOM`kGCQZM=DHQEMbu/:\" x=\"1450\" y=\"290\"><statement name=\"custom_block\"><shadow type=\"procedures_prototype\" id=\"f*_VQdK?|HJ4-h;2OAA#\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" proccode=\"lights %n\" proceduredefid=\"f*_VQdK?|HJ4-h;2OAA#\" argumentids=\"[&quot;tR*pBG{pSIiB=!g+y,uO&quot;]\" argumentnames=\"[&quot;loops&quot;]\" argumentdefaults=\"[&quot;todo&quot;]\" argumenttypes=\"[&quot;n&quot;]\" warp=\"false\"></mutation><value name=\"tR*pBG{pSIiB=!g+y,uO\"><shadow type=\"argument_reporter_number\" id=\"B?.Cr2J~%)V~{a/:+i36\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" funcname=\"lights_loops\" argumentid=\"tR*pBG{pSIiB=!g+y,uO\" proceduredefid=\"f*_VQdK?|HJ4-h;2OAA#\"></mutation><field name=\"VALUE\">loops</field></shadow></value></shadow></statement><next><block type=\"iq_control_repeat\" id=\"T3_ai1[z1aq@CWEof./o\"><value name=\"TIMES\"><shadow type=\"math_whole_number\" id=\"r1=}m@wY#H$ADYAOkjox\"><field name=\"NUM\">10</field></shadow><block type=\"argument_reporter_number\" id=\"R6$$f`*x=ps_LG:{/c@}\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" funcname=\"lights_loops\" argumentid=\"tR*pBG{pSIiB=!g+y,uO\" proceduredefid=\"f*_VQdK?|HJ4-h;2OAA#\"></mutation><field name=\"VALUE\">loops</field></block></value><statement name=\"SUBSTACK\"><block type=\"iq_variables_set_variable\" id=\"~bT]0.nTY:Fv/g#JbJ;;\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"B/7^b|om?/`g`SEvx!E|\"><field name=\"NUM\">0</field></shadow><block type=\"iq_operator_random\" id=\"/uJ@Etb^j/4[Rn.L-^JU\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"_|m|.-9@nsh$NwmKPr6V\"><field name=\"NUM\">1</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"zYtu_y$F$btJd,6Nu|~Q\"><field name=\"NUM\">13</field></shadow></value></block></value><next><block type=\"iq_control_if_elseif_else\" id=\"tyFPDUUvQ(k,cA91,5)l\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" branches=\"7\"></mutation><value name=\"CONDITION1\"><block type=\"iq_operator_equal_to\" id=\"5Ww1^-Z`b^;E5nynR[eC\"><value name=\"OPERAND1\"><shadow type=\"math_number\" id=\"0vJncC~!h,W@k.Gdnyhw\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"uWlB=d^zwC3`o#}T%x`/\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"st}GQ?$P`[PpiG$NnDj!\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"SUBSTACK1\"><block type=\"iq_looks_set_touchled_color\" id=\".gEy50^d|EzocLg6t!bB\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"s?*2vrCvF[;#[!!=JA!M\"><field name=\"COLOR\">red</field></shadow></value></block></statement><value name=\"CONDITION2\"><block type=\"iq_operator_equal_to\" id=\".s?P?dOJGkCJlI6]oggd\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"s2O+.sS?(Fek+;0Tx`Su\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"oion}t16V;R4AD@lp(-5\"><field name=\"NUM\">2</field></shadow></value></block></value><statement name=\"SUBSTACK2\"><block type=\"iq_looks_set_touchled_color\" id=\"b30NVALoDJk`c936HM[I\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"tkD~enD({RA?Y`*;Ofx8\"><field name=\"COLOR\">blue</field></shadow></value></block></statement><value name=\"CONDITION3\"><block type=\"iq_operator_equal_to\" id=\"=Ig?6![5?UyD{H#?LG=+\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"$XoK@8XQ(#PS7(`}|.m-\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"g-dNE8l7q!6.N_q:(vpm\"><field name=\"NUM\">3</field></shadow></value></block></value><statement name=\"SUBSTACK3\"><block type=\"iq_looks_set_touchled_color\" id=\"H+l6f;O2z[L/CId{#yU0\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"(+_YfJDTZ8{2%k!0]Bs{\"><field name=\"COLOR\">white</field></shadow></value></block></statement><value name=\"CONDITION4\"><block type=\"iq_operator_equal_to\" id=\"IE?1PhxxI`3n8I/pXfmm\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"@+k:yie24+qfiMFv(5ns\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"e8Q]G:nIyv:vr`8uSzI.\"><field name=\"NUM\">4</field></shadow></value></block></value><statement name=\"SUBSTACK4\"><block type=\"iq_looks_set_touchled_color\" id=\"!DDYbG|x9WVH`F~usgT)\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"TPT^VA%NDm{5e{:7A{[E\"><field name=\"COLOR\">yellow</field></shadow></value></block></statement><value name=\"CONDITION5\"><block type=\"iq_operator_equal_to\" id=\"+w-5T+qtL*yCCC*nGN~l\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"Oo?6)2.Go{.#J-K21ZD:\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"MmmdV{!(rnX2yXalSkO+\"><field name=\"NUM\">5</field></shadow></value></block></value><statement name=\"SUBSTACK5\"><block type=\"iq_looks_set_touchled_color\" id=\"432s2aXzi?ZN$zS%9mIi\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"6E$:)w|C8d.~YPivj#L4\"><field name=\"COLOR\">orange</field></shadow></value></block></statement><value name=\"CONDITION6\"><block type=\"iq_operator_equal_to\" id=\"LG@Y}!FQVQL.ZzZs,OWG\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"eZ3S(Zec8#yGj,WWw3D]\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"ht5OL9(eMOkr6NrKa:Q0\"><field name=\"NUM\">6</field></shadow></value></block></value><statement name=\"SUBSTACK6\"><block type=\"iq_looks_set_touchled_color\" id=\",kQt%`noE9;Y8:Xt*kI}\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"$|1/IJ2rrvcca/WFWa8]\"><field name=\"COLOR\">green</field></shadow></value></block></statement><value name=\"CONDITION7\"><block type=\"iq_operator_equal_to\" id=\")t2$,Vz@s`WC7QwlB)*2\"><value name=\"OPERAND1\"><shadow type=\"math_number\" id=\"DHz-G3?*jU1SeP3pcO~y\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"}ryZ%%vpX`bm;LVgp+v8\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"=76t,j:b?TYLXY7O~3!c\"><field name=\"NUM\">7</field></shadow></value></block></value><statement name=\"SUBSTACK7\"><block type=\"iq_looks_set_touchled_color\" id=\"hCwXf-o,30F$Ju7q{uD5\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"4n[LzPqmmB9dzwAgQM*1\"><field name=\"COLOR\">red_violet</field></shadow></value></block></statement><statement name=\"SUBSTACK_ELSE\"><block type=\"iq_control_if_elseif_else\" id=\"JnHK=o$I.|KGOp[}SWG4\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" branches=\"5\"></mutation><value name=\"CONDITION1\"><block type=\"iq_operator_equal_to\" id=\"~OMZp(RqxhOK96J+%5`U\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"cXBRh$S2gdZP:.})M@V#\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"d,z^0XZb*6Lk!a}AK==r\"><field name=\"NUM\">8</field></shadow></value></block></value><statement name=\"SUBSTACK1\"><block type=\"iq_looks_set_touchled_color\" id=\"CGTgcGh?+o*XmBn7^g@)\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"$2+v4W;8a?]tjwIZNf]k\"><field name=\"COLOR\">purple</field></shadow></value></block></statement><value name=\"CONDITION2\"><block type=\"iq_operator_equal_to\" id=\"3=2jH/*3EMkziy4X+8Io\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"7ai.IK*%{Wzz(W*qAnaC\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"/dC,?Wy@xy)urJ9^.9OR\"><field name=\"NUM\">9</field></shadow></value></block></value><statement name=\"SUBSTACK2\"><block type=\"iq_looks_set_touchled_color\" id=\"pcd0[Qm+7BD7/n!`%$Q9\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"dJZOCeEK,_Id*_7{=/?9\"><field name=\"COLOR\">violet</field></shadow></value></block></statement><value name=\"CONDITION3\"><block type=\"iq_operator_equal_to\" id=\"qR/Yf6/bkF30%nI-B1H#\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"WfX@FzE65$HsvG%FY49v\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"ln^)tUNherpf}hyY2j-Z\"><field name=\"NUM\">10</field></shadow></value></block></value><statement name=\"SUBSTACK3\"><block type=\"iq_looks_set_touchled_color\" id=\"#5N9],gHKz!Lu=?{.Ui2\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"/BPiB:f-#:mIb#fX%{#%\"><field name=\"COLOR\">red_orange</field></shadow></value></block></statement><value name=\"CONDITION4\"><block type=\"iq_operator_equal_to\" id=\"uynV:C}J4ob15lMMot|G\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"vFB^qV2fM8tpgGs}Z3vp\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"nZ6z$cLOWO;K{+V`3C;M\"><field name=\"NUM\">11</field></shadow></value></block></value><statement name=\"SUBSTACK4\"><block type=\"iq_looks_set_touchled_color\" id=\"#wnth}h[`GqE;oZT5sjX\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"L}+j|M)i+?Gxp%)aTIB^\"><field name=\"COLOR\">yellow_orange</field></shadow></value></block></statement><value name=\"CONDITION5\"><block type=\"iq_operator_equal_to\" id=\"2gE8a.f]t4M2m4nIhHz2\"><value name=\"OPERAND1\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"iq_variables_variable\" id=\"8.$B!H-AqQgWHx{:ZfB9\"><field name=\"VARIABLE\" id=\"_2.^beQjx|FGt38A,8(E\">myVariable</field></block></value><value name=\"OPERAND2\"><shadow type=\"math_number\" id=\"4^|rKWB2X23VvndArnYA\"><field name=\"NUM\">12</field></shadow></value></block></value><statement name=\"SUBSTACK5\"><block type=\"iq_looks_set_touchled_color\" id=\"-YU]9nbWzIZ-+?xyk%B*\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"j]N6=!$sAA3JN$U%r]G(\"><field name=\"COLOR\">yellow_green</field></shadow></value></block></statement><statement name=\"SUBSTACK_ELSE\"><block type=\"iq_looks_set_touchled_color\" id=\"RUoO@6Dv%NV|Ew]H:xk[\"><field name=\"TOUCHLED\">TouchLED5</field><value name=\"COLOR\"><shadow type=\"iq_looks_colorlist\" id=\"km75`}URX2-`4Q9A%a{}\"><field name=\"COLOR\">blue_green</field></shadow></value></block></statement></block></statement></block></next></block></statement></block></next></block></xml>","rconfig":[{"port":[8],"name":"leftbumper","customName":true,"deviceType":"Bumper","deviceClass":"bumper","setting":{},"triportSourcePort":22},{"port":[9],"name":"rightbumper","customName":true,"deviceType":"Bumper","deviceClass":"bumper","setting":{},"triportSourcePort":22},{"port":[5],"name":"TouchLED5","customName":false,"deviceType":"TouchLED","deviceClass":"touchled","setting":{},"triportSourcePort":22},{"port":[1,6,4],"name":"Drivetrain","customName":false,"deviceType":"Drivetrain","deviceClass":"smartdrive","setting":{"type":"2-motor","wheelSize":"200mm","gearRatio":"1:1","direction":"fwd","gyroType":"smart","width":"173","unit":"mm","wheelbase":"76","wheelbaseUnit":"mm","xOffset":"0","yOffset":"0","thetaOffset":"0"},"triportSourcePort":22},{"port":[2],"name":"Distance2","customName":false,"deviceType":"Distance","deviceClass":"distance","setting":{}},{"port":[3],"name":"Optical3","customName":false,"deviceType":"Optical","deviceClass":"optical","setting":{}}],"slot":1,"platform":"IQ","sdkVersion":"20230627.09.00.00","appVersion":"3.0.0","minVersion":"3.0.0","fileFormat":"1.2.0","icon":"","targetBrainGen":"First","v5SoundsEnabled":false,"downloadLanguage":"python","cppStatus":"true","cpp":"// Make sure all required headers are included.\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n#include <math.h>\n#include <string.h>\n\n\n#include \"vex.h\"\n\nusing namespace vex;\n\n// Brain should be defined by default\nbrain Brain;\n\n\n// START IQ MACROS\n#define waitUntil(condition)                                                   \\\n  do {                                                                         \\\n    wait(5, msec);                                                             \\\n  } while (!(condition))\n\n#define repeat(iterations)                                                     \\\n  for (int iterator = 0; iterator < iterations; iterator++)\n// END IQ MACROS\n\n\n// Robot configuration code.\nbumper leftbumper = bumper(PORT8);\nbumper rightbumper = bumper(PORT9);\ntouchled TouchLED5 = touchled(PORT5);\nmotor LeftDriveSmart = motor(PORT1, 1, false);\nmotor RightDriveSmart = motor(PORT6, 1, true);\ngyro DrivetrainGyro = gyro(PORT4, true);\nsmartdrive Drivetrain = smartdrive(LeftDriveSmart, RightDriveSmart, DrivetrainGyro, 200);\n\ndistance Distance2 = distance(PORT2);\noptical Optical3 = optical(PORT3);\n\nvoid calibrateDrivetrain() {\n  wait(200, msec);\n  Brain.Screen.print(\"Calibrating\");\n  Brain.Screen.newLine();\n  Brain.Screen.print(\"Gyro\");\n  DrivetrainGyro.calibrate();\n  while (DrivetrainGyro.isCalibrating()) {\n    wait(25, msec);\n  }\n\n  // Clears the screen and returns the cursor to row 1, column 1.\n  Brain.Screen.clearScreen();\n  Brain.Screen.setCursor(1, 1);\n}\n\n// Generated code.\n\n// Include the IQ Library\n#include \"vex.h\"\n  \n// Allows for easier use of the VEX Library\nusing namespace vex;\n\n// User defined function\nvoid myblockfunction_lights_loops(double myblockfunction_lights_loops__loops);\n\nint Brain_precision = 0, Console_precision = 0;\n\nfloat myVariable;\n\nfloat length[2];\n\nevent lights_on = event();\nevent message1 = event();\n\nint mathRandomInt(float a, float b) {\n  if (a > b) {\n    // Swap a and b to ensure a is smaller.\n    float c = a;\n    a = b;\n    b = c;\n  }\n  int tmpA = static_cast<int>(a);\n  int tmpB = static_cast<int>(b);\n  int r = tmpA + rand() / (RAND_MAX / (tmpB - tmpA + 1));\n  return r;\n}\n\n// User defined function\nvoid myblockfunction_lights_loops(double myblockfunction_lights_loops__loops) {\n  repeat(myblockfunction_lights_loops__loops) {\n    myVariable = static_cast<float>(mathRandomInt(1.0, 13.0));\n    if (myVariable == 1.0) {\n      TouchLED5.setColor(red);\n    } else if (myVariable == 2.0) {\n      TouchLED5.setColor(blue);\n    } else if (myVariable == 3.0) {\n      TouchLED5.setColor(white);\n    } else if (myVariable == 4.0) {\n      TouchLED5.setColor(yellow);\n    } else if (myVariable == 5.0) {\n      TouchLED5.setColor(orange);\n    } else if (myVariable == 6.0) {\n      TouchLED5.setColor(green);\n    } else if (myVariable == 7.0) {\n      TouchLED5.setColor(red_violet);\n    } else {\n      if (myVariable == 8.0) {\n        TouchLED5.setColor(purple);\n      } else if (myVariable == 9.0) {\n        TouchLED5.setColor(violet);\n      } else if (myVariable == 10.0) {\n        TouchLED5.setColor(red_orange);\n      } else if (myVariable == 11.0) {\n        TouchLED5.setColor(yellow_orange);\n      } else if (myVariable == 12.0) {\n        TouchLED5.setColor(yellow_green);\n      } else {\n        TouchLED5.setColor(blue_green);\n      }\n    }\n    wait(20, msec);\n  }\n}\n\n// \"when started\" hat block\nint whenStarted1() {\n  Drivetrain.drive(forward);\n  waitUntil((Optical3.colorname() == green));\n  Drivetrain.stop();\n  return 0;\n}\n\n// \"when I receive lights_on\" hat block\nvoid onevent_lights_on_0() {\n  myblockfunction_lights_loops(1.0);\n}\n\n\nint main() {\n  // initialize the random number system\n  srand(Brain.Timer.system());\n\n  // Calibrate the Drivetrain Gyro\n  calibrateDrivetrain();\n\n  // register event handlers\n  lights_on(onevent_lights_on_0);\n\n  wait(15, msec);\n  whenStarted1();\n}","target":"Physical"}